package com.cs.study.homework._0216;

public class Grade {
    public static void main(String[] args) {
        Student student1 = new Student("张三", 1, "男", 15,60);
        Student student2 = new Student("李四", 2, "男", 16,78);
        Student student3 = new Student("王五", 3, "男", 12,62);
        Student student4 = new Student("赵六", 4, "男", 15,100);
        Student student5 = new Student("路人甲", 5, "男", 15,66);

        student1.print();
        student2.print();
        student3.print();
        student4.print();
        student5.print();

        double average = (double) Student.sum / Student.count;
        System.out.println("平均分：" + average);

    }
}


class Student {
    String name;
    int stuId;
    String gender;
    int age;
    double score;
    static int count;
    static int sum;


    public Student(String name, int stuId, String gender,int age, int score) {
        this.age = age;
        this.score = score;
        this.name = name;
        this.stuId = stuId;
        this.gender = gender;
        count++;
        sum += score;
    }

    public void print(){
        System.out.println("姓名：" + name + " 学号：" + stuId + " 性别：" + gender + " 年龄：" + age + " 成绩：" + score);
    }
}